PLATFORM DEVELOPER I Exam PDI Questions V10.02 Platform Developer I Topics - Platform Developer I Valid PDI Study Guide [2022] For Passing Successfully 1.A developer created these three Rollup Summary fields in the custom object, Project_ct, The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project. Which should the developer use to Implement the business requirement in order to minimize maintenance overhead? A. Record-triggered Flow B. Formula field C. Apex Trigger D. Process Builder Answer: B 2.Which three statements are true regarding trace flags? (Choose three.) A. Setting trace flags automatically cause debug logs to be generated. B. Logging levels override trace flags. C. Trace flags override logging levels. D. If active trace flags are not set, Apex tests execute with default logging levels. E. Trace flags can be set in the Developer Console, Setup, or using the Tooling API. Answer: C,D,E 3.A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of test allowing them to test independent requirements various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test? A. Use @TestSetup with a viod method. B. Create test data before Test.startTest() in the unit test. C. Add @isTest(seeAllData=true) at the start of the unit test class. D. Create a nock using the Stud API Answer: A 4.A developer uses a loop to check each Contact in a list. When a Contact with the Title of “Boss” is found, the Apex method should jump to the first line of code outside Valid PDI Study Guide [2022] For Passing Successfully of the for loop. Which Apex solution will let the developer implement this requirement? A. break; B. Continue C. Next D. Exit Answer: A 5.A developer has the following requirements: Calculate the total amount on an Order. Calculate the line amount for each Line Item based on quantity selected and price. Move Line Items to a different Order if a Line Item is not stock. Which relationship implementation supports these requirements? A. Line Items has a Master-Detail field to Order and the Master can be re-parented. B. Line Item has a Lookup field to Order and there can be many Line Items per Order C. Order has a Lookup field to Line Item and there can be many Line Items per Order. D. Order has a Master-Detail field to Line Item and there can be many Line Items per Order. Answer: A 6.What should a developer use to obtain the Id and Name of all the Leads. Accounts, and Contacts that hove the company name "Universal Containers"? A. FIND 'Universal Containers' IN Name Fields RETURNING leadjid, name), accounted, name), contacted, name) B. FIND Universal Containers' IN CompanyName Fietds RETURNING lead{ld. name), accounted, name), contacted, name) C. SELECT lead(id, name). accountOd, name), contacted, name) FROM Lead, Account, Contact WHERE Name = "universal Containers' D. SELECT Lead.id. Lead.Name, Account.Id, AccountName, Contacted, Contact.Name FROM Lead, Account, Contact WHERE CompanvName * Universal Containers' Answer: A 7.A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of new Apex helper class. Change Set deployment to production fails with the test coverage warning: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required" What should the developer do to successfully deploy the new Apex trigger and helper class? A. Create a test class and methods to cover the Apex trigger Valid PDI Study Guide [2022] For Passing Successfully B. Run the tests using the 'Run All Tests' method. C. Remove the falling test methods from the test class. D. Increase the test class coverage on the helper class Answer: C 8.Universal Containers wants Opportunities to be locked from editing when reaching the Closed/Won stage. Which two strategies should a developer use to accomplish this? Choose 2 answers A. Use a validation rule. B. Use a trigger. Answer: A,B 9.When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be update based on the values in a PostalCodeToTimezone__c custom object. How should a developer implement this feature? A. Build an Account Assignment Rule. B. Build an Account custom Trigger. C. Build an account Approval Process D. Build an Account Workflow Rule. Answer: B 10.A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent. Which action will allow the developer to relate records in the data model without knowing the Salesforce ID? A. Create a custom field on the child object of type Foreign Key B. Create and populate a custom field on the parent object marked as Unique C. Create and populate a custom field on the parent object marked as an External ID. D. Create a custom field on the child object of type External Relationship. Answer: C 11.A software company uses the following objects and relationships: • Case: to handle customer support issues • Defect_c: a custom object to represent known issues with the company's software • case_Defect__c: a junction object between Case and Defector to represent that a defect Is a customer issue Valid PDI Study Guide [2022] For Passing Successfully What should be done to share a specific Case-Defect_c record with a user? A. Share the Case_Defect_c record. B. Share the parent Case record. C. Share the parent Defect_c record. D. Share the parent Case and Defect_c records. Answer: D 12.Given the following trigger implementation: trigger leadTrigger on Lead (before update){ final ID BUSINESS_RECORDTYPEID = '012500000009Qad'; for(Lead thisLead : Trigger.new){ if(thisLead.Company != null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID; } } } The developer receives deployment errors every time a deployment is attempted from Sandbox to Production. What should the developer do to ensure a successful deployment? A. Ensure BUSINESS_RECORDTYPEID is retrieved using Schema.Describe calls. B. Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment. C. Ensure BUSINESS_RECORDTYPEID is pushed as part of the deployment components. D. Ensure the deployment is validated by a System Admin user on Production. Answer: B 13.A developer created a weather app that contains multiple Lightning web components. One of the components, called Toggle, has a toggle for Fahrenheit or Celsius units. Another component, called Temperature, displays the current temperature in the unit selected in the Toggle component When a user toggles from Fahrenheit to Celsius or vice versa in the Toggle component, the information must be sent to the Temperature component so the temperature can be converted and displayed. What is the recommend way to accomplish this? A. Create a custom event to handle the communicate between the components. B. Use Lightning Message Service to communicate between the component. C. Use Lightning Message Service to communicate between the components. D. The Toggle component should call a method in the Temperature component. Valid PDI Study Guide [2022] For Passing Successfully Answer: A 14.Which code displays the content of Visualforce page as PDF? A. <apex:page renderAs=”pdf”> B. <apex:page readeras’’ application/pdf’’> C. <apex:page readerAs= ‘’application/pdf’’> D. <apex:page contentype ‘’ application/pdf’’) Answer: A 15.Given the following block code: try {List <Accounts> retrievedRecords = [SELECT Id FROM Account WHERE Website = null];} catch (Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the retrievedRecordslist remains empty after the SOQL query? A. Check the state of the retrieveRecords variable and throw a custom exception if the variable is empty. B. Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty C. Check the state of the retrievedRecords variable and access the first element of the list if the variable is empty. D. Replace the retrievedRecords variable declaration from ftount to a single Account. Answer: B 16.How should a developer write unit tests for a private method in an Apex class? A. Use the SeeAllData annotation. B. Add a test method in the Apex class. C. Use the TestVisible annotation. D. Mark the Apex class as global. Answer: C 17.A developer must provide custom user interfaces when users edit a Contact in either Salesforce Classic or Lightning Experience. What should the developer use to override the Contact's Edit button and provide this functionality? A. A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience B. A Lightning component in 5alesforce Classic and a Lightning component in lightning Experience C. A Visualforce page in Salesforce Classic and a Lightning page in Lightning Valid PDI Study Guide [2022] For Passing Successfully Experience D. A Lightning page in Salesforce Classic and a Visualforce page in Lightning Experience Answer: A 18.What can used to delete components from production? A. A change set deployment with the delete option checked B. An ant migration tool deployment with destructivechanges xml file and the components to delete in the package .xml file C. A change set deployment with a destructivechanges XML file D. An ant migration tool deployment with a destructivechanges XML file and an empty package .xml file Answer: B 19.What should a developer do to check the code coverage of a class after running all tests? A. View the Code Coverage column in the view on the Apex Classes page. B. View the Class test Coverage tab on the Apex Class record. C. view the overall Code Coverage panel of the tab in the Developer Console. D. Select and run the class on the Apex Test Execution page Answer: B 20.A team of many developers work in their own individual orgs that have the same configuration at the production org. Which type of org is best suited for this scenario? A. Developer Sandbox B. Developer Edition C. Full Sandbox D. Partner Developer Edition Answer: A 21.Which action may cause triggers to fire? A. Updates to Feed Items B. Renaming or replacing a picklist entry C. Changing a user's default division when the transfer division option is checked D. Cascading delete operations Answer: A Valid PDI Study Guide [2022] For Passing Successfully 22.What are three characteristics of change set deployments? Choose 3 answers A. Change sets can only be used between related organizations. B. Change sets can be used to transfer records. C. Sending a change set between two orgs requires a deployment connection. D. Change sets can deploy custom settings data. E. Deployment is done in a one-way, single transaction. Answer: A,B,E 23.Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers A. $Lightning.createComponent B. <apex:slds/> C. $Lightning.useComponent D. $Lightning.use E. <apex:includeLightning/> Answer: A,D,E 24.A developer has a requirement to create an Order When an Opportunity reaches a "Closed-Won" status. Which tool should be used to implement this requirement? A. Process Builder B. Lightning Component C. Lightning D. Apex trigger Answer: A 25.Which Lightning code segment should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page? A) B) Valid PDI Study Guide [2022] For Passing Successfully C) D) A. Option A B. Option B C. Option C D. Option D Answer: A 26.A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violation to the user. How can the developer make sure that validation rule violations are displayed? A. Add cuatom controller attributes to display the message. B. Include <apex:message> on the Visualforce page. C. Use a try/catch with a custom exception class. D. Perform the DML using the Database.upsert() method. Answer: B 27.Universal Containers decides to use purely declarative development to build out a new Salesforce application. Which three options can be used to build out the business logic layer for this application? Choose 3 answers A. Flow Builder B. Validation Rules C. Process builder Valid PDI Study Guide [2022] For Passing Successfully Answer: A,B,C 28.Cloud kicks has a multi-screen flow that its call center agents use when handling inbound service desk calls. At one of the steps in the flow, the agents should be presented with a list of order numbers and dates that are retrieved from an external order management system in real time and displayed on the screen. What should a developer use to satisfy this requirement? A. An Apex controller B. An Apex REST class C. An outbound message D. An invocable method Answer: B 29.Which standard field is required when creating a new contact record? A. LastName B. Name C. AccountId D. FirstName Answer: A 30.What are two characteristics related to formulas? Choose 2 answers. A. Formula can reference themselves. B. Formulas are calculated at runtime and are not stored in the database. C. Formulas can reference values in related objects. D. Fields that are used in a formula field can be deleted or edited without the formula. Answer: B,C 31.When a user edits the Postal Code on an Account, a custom Account text field named ''Timezone'' must be updated based on the values in a postalCodeToTimezone_c custom object. What should be built to implement this feature? A. Account custom trigger B. Account approval process C. Account assignment rule D. Account workflow rule Answer: A Valid PDI Study Guide [2022] For Passing Successfully 32.As part of a data cleanup strategy, AW Computing wants to proactively delete associated opportunity records when the related Account is deleted. Which automation tool should be used to meet this business requirement? A. Workflow Rules B. Scheduled job C. Record-Triggered Flow D. Process Builder Answer: C 33.A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or updated. The field update in the workflow rule is configured to not re-evaluate workflow rules. What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account? A. 1 B. 3 C. 4 D. 2 Answer: D 34.Which two statements are accurate regarding Apex classes and interfaces? Choose 2 answers A. Classes are final by default. B. Inner classes are public by default. C. Interface methods are public by default. D. A top-level class can only have one inner class level. Answer: C,D 35.What should a developer do to check the code coverage of a class after running all tests? A. View the Code Coverage column in the list view on the Apex Classes page. B. View the Class Test Percentage tab on the Apex Class fist view m Salesforce Setup. C. View Use cede coverage percentage for the class using the Overall Code Coverage panel in the Developer Console Tests tab. D. Select and run the class on the Apex Test Execution page in the Developer Console. Answer: B Valid PDI Study Guide [2022] For Passing Successfully 36.A developer receives an error when trying to call a global server-side method using the ©remoteAction decorator. How can the developer resolve the error? A. Change the function signature to be private static. B. Add static to the server-side method signature. C. A Decorate the server-side method with (static=true). D. Decorate the server-side method with (static=false). Answer: B 37.If apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which statement are true regarding governor limits? Choose 2 answers A. The Apex governor limits might be higher due to the asynchronous nature of the transaction. B. The apex governor limits are reset for each iteration of the execute() method. C. The Apex governor limits are relaxed while calling the constructor of the Apex class. D. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction, Answer: A,B 38.In terms of the MVC paradigm, what are two advantages of implementing the layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers A. Self-contained and reusable units of an application B. Rich component ecosystem C. Automatic code generation D. Server-side run-time debugging Answer: A,B 39.Refer to the following Apex code: Valid PDI Study Guide [2022] For Passing Successfully What is the value of x when it is written to the debug log? A. 0 B. 1 C. 2 D. 3 Answer: C 40.A developer wants to mark each Account in a List<Account> as either or Inactive based on the LastModified field value being more than 90 days. Which Apex technique should the developer use? A. A for loop, with a switch statement inside B. A Switch statement, with a for loop inside C. An If/else statement, with a for loop inside D. A for loop, with an if/else statement inside Answer: D 41.What is a benefit of developing applications in a multi-tenant environment? A. Enforced best practices for development B. Access to predefined computing resources C. Unlimited processing power and memory D. Default out-of-the-box configuration Answer: D 42.A developer has a VF page and custom controller to save Account records. The Valid PDI Study Guide [2022] For Passing Successfully developer wants to display any validation rule violation to the user. How can the developer make sure that validation rule violations are displayed? A. Add custom controller attributes to display the message. B. Include <apex:messages> on the Visualforce page. C. Use a try/catch with a custom exception class. D. Perform the DML using the Database.upsert() method Answer: B Explanation: https://developer.salesforce.com/docs/atlas.en- us.pages.meta/pages/pages_compref_message.htm 43.A developer writes a single trigger on the Account object on the after insert and after update events. A workflow rule modifies a field every time an Account is created or updated. How many times will the trigger fire if a new Account is inserted, assuming no other automation logic is implemented on the Account? A. 4 B. 1 C. 2 D. 8 Answer: C 44.Which code displays the contents of a Visualforce page as a PDF? A. <apex:page contentType="pdf"> B. <apex:page rendersAs="application/pdf"> C. <apex:page contentType="application/pdf"> D. <apex:page renderAs="pdf"> Answer: D Explanation: https://developer.salesforce.com/docs/atlas.en- us.pages.meta/pages/pages_output_pdf_renderas.htm You can generate a downloadable, printable PDF file of a Visualforce page using the PDF rendering service. Convert a page to PDF by changing the <apex:page> tag. <apex:page renderAs="pdf"> 45.Which two statements are true about Getter and Setter methods as they relate to Visualforce? A. Setter methods always have to be declared global. B. There is no guarantee for the order in which Getter methods are called. C. A corresponding Setter method is required for each Getter method. Valid PDI Study Guide [2022] For Passing Successfully D. Getter methods pass values from a controller to a page. Answer: C,D 46.What will be the output in the debug log in the event of a QueryExeption during a call to the @query method in the following Example? A. Querying Accounts. Query Exception. B. Querying Accounts. Custom Exception. C. Querying Accounts. Query Exception. Done D. Querying Accounts. Custom Exception Done. Answer: C 47.What is the maximum number of SOQL queries used by the following code? List<Account> aList = [SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); } A. 5 B. 6 C. 1 D. 2 Answer: B Valid PDI Study Guide [2022] For Passing Successfully 48.An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web components to use. What is the correct definition of a Lightning Web component property that uses the getAccounts method? A. Option A B. Option B C. Option C D. Option D Answer: A 49.In the Lightning UI, where should a developer look to find information about a Paused Flow Interview? A. On the Paused Row Interviews related List for a given record B. In the Paused Interviews section of the Apex Flex Queue C. In the system debug log by Altering on Paused Row Interview D. On the Paused Row Interviews component on the Home page Answer: B 50.A developer is asked to create a Visualforce page that displays some Account fields as well as fields configured on the page layout for related Contacts. How should the developer implement this request? A. Use the <apex:relatedList> tag. B. Create a controller extension. C. Use the <apex:include> tag. D. Add a method to the standard controller. Answer: A Valid PDI Study Guide [2022] For Passing Successfully 51.Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy this requirement. Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, It fails with system. Exception errors. Which two actions should the developer take to fix the code segment shown above? Choose 2 answers A. Check if all the required fields for Opportunity are being added on creation. B. Use Database.query to query the opportunities. C. Move the DML that saves opportunities outside the for loop. D. Query for existing opportunities outside the for loop. Answer: C,D 52.Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation. What are two characteristics of declarative development over programmatic customization? Choose 2 answers A. Declarative development has higher design limits and query limits. B. Declarative development can be done using the Setup UI. C. Declarative development does not require Apex test classes. D. Declarative code logic does not require maintenance or review. Answer: B,C 53.Which three per-transaction limits have higher governor limits in asynchronous Apex transactions? A. Maximum CPU time B. Maximum heap size C. Total SOQL queries Valid PDI Study Guide [2022] For Passing Successfully D. Maximum execution time E. Records returned by SOQL Answer: A,C,E 54.The following code snippet is executed by a Lightning web component in an environment with more than 2,000 lead records: Which governor limit will likely be exceeded within the Apex transaction? A. Total number of DML statement issued B. Total number of SOQL queries issued C. Total number of records retrieved by SOQL queries D. Total number of records processed as a result of DML statements Answer: C 55.A developer needs to update an unrelated object when a record gets saved. Which two trigger types should the developer create? A. After insert B. After update C. Before update D. Before insert Answer: C,D 56.Universal Containers stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are available. Which method should be used to calculate the estimated ship date for an Order? A. Use a CEILING formula on each of the Latest availability date fields. B. Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order. Valid PDI Study Guide [2022] For Passing Successfully C. Use a LATEST formula on each of the latest availability date fields. D. Use a Max Roll-Up Summary field on the Latest availability date fields. Answer: D 57.A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the price book? A. Use Test.loadData ( )and a static resource to load a standard price book B. Use @TestVisible to allow the test method to see the standard price book. C. Use Test,getStandardPricebookid ( ) to get the standard price book ID. D. Use @IsTest (SeeAllData=True) and delete the existing standard price book Answer: C 58.A developer wrote Apex code that calls out to an external system. How should a developer write the test to provide test coverage? A. Write a class that extends HTTPCalloutMock. B. Write a class that implements the HTTPCalloutMock interface. C. Write a class that implements the WebserviceMock interface. D. Write a class that extends WebserviceMock Answer: B 59.What should a developer use to fix a Lightning web component bug in a sandbox? A. Developer Console B. Force.com IDE C. Execute Anonumous D. VS Code Answer: D 60.A developer is tasked with performing a complex validation using Apex as part of advanced business logic. certain criteria are met for a PurchaseOrder, the developer must throw a custom exception. What is the correct way for the developer to declare a class that can be used as an exception? A. public class PurchaseOrderException implements Exception () B. public class PurchaseOrderException extends Exception () C. public class PurchaseOrder implements Exception () D. public class PurchaseOrder extends Exception () Answer: B Valid PDI Study Guide [2022] For Passing Successfully 61.A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub- classes can override. What is the correct implementation of the ShippingCalculator class? A. Public abstract class ShippingCalculator { public override calculate() { /*implementation*/ } } B. Public abstract class ShippingCalculator { public virtual void calculate() { /*implementation*/ } } C. Public abstract class ShippingCalculator { public abstract calculate() { /*implementation*/ } } D. Public abstract class ShippingCalculator { public void calculate() { /*implementation*/ } } Answer: B Explanation: the extending class can override the existing virtual methods by using the override keyword in the method definition. Overriding a virtual method allows you to provide a different implementation for an existing method https://developer.salesforce.com/docs /atlas.en-us.apexcode.meta/apexcode/apex_classes_extending.htm 62.A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an Orderltem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders. What should a developer do to allow their code to move some existing Orderltem records to a new Order record? A. Change the master-detail relationship to an external lookup relationship. B. Add without sharing to the Apex class declaration. C. Create a junction object between Orderltem and Order. D. Select the Allow reparenting option on the master-detail relationship. Answer: C 63.What is the result of the following code? A. The record will not be created and a exception will be thrown. B. The record will be created and a message will be in the debug log. C. The record will not be created and no error will be reported. D. The record will be created and no error will be reported. Answer: C